#pragma once
#include "Encoder.h"
#include <QThread>
#include <concurrent_queue.h>
#include <atomic>

class NetStream
	:protected QThread
{
public:
	NetStream(QObject* parent = nullptr);
	~NetStream();
	int Init();
	void Uninit();

	virtual void Output(BYTE* data, int64_t len);

protected:
	virtual void run() override;

private:

	typedef struct Data {
		BYTE* data;
		uint64_t len;
	};

	std::atomic_bool m_isRuning;
	concurrency::concurrent_queue<Data> m_dataQueue;
	HANDLE m_dataQueueSema;
};

